#ifndef __COMPONENT_DAMAGE_H__
#define __COMPONENT_DAMAGE_H__

#include "Component.hpp"
#include "Subsystems/SubsystemTimeOfDay.h"

namespace PocketSurvival
{

    struct ComponentOnFire;
    struct ComponentBody;

    struct ComponentDamage : public Component
    {
        float hitpoints;
        float attackResilience;
        float fallResilience;
        float fireResilience;

        ComponentOnFire *componentOnFire;
        ComponentBody *componentBody;

        void damage(float amount);

        virtual void update(float dt) override;
        virtual const std::string &getName() const override;
        static const std::string &GetName();
        virtual void load(const nlohmann::json &jsonData) override;
        virtual void save(nlohmann::json &jsonData) override;
    };

} // namespace PocketSurvival

#endif
